﻿#ifndef UDPLISTENER_H
#define UDPLISTENER_H

#include <QObject>
#include <QUdpSocket>

#define LEFT_ROBOT 0
#define RIGHT_ROBOT 1
class UDPListener : public QObject
{
    Q_OBJECT
public:
    explicit UDPListener(QObject *parent = nullptr);
    void setTrigger(QString str) {m_trigger = str;}
signals:
    void trigger(int robotNo, QString recipe, QString leftPanelID, QString rightPanelID); //0 表示LEFT ROBOT，1表示 RIGHT ROBOT
    void robotLoading(int robotNo); //0 表示LEFT ROBOT，1表示 RIGHT ROBOT
private slots:
    void onReadyRead();
private:
    QUdpSocket *socket;
    QString m_trigger;
};

#endif // UDPLISTENER_H
